
Imports System.Data
Imports System.Data.SqlClient
Public Class frmPriceReport
    Inherits System.Windows.Forms.Form

    Dim icpEdit As ICproductsEdit

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents gbType As System.Windows.Forms.GroupBox
    Friend WithEvents rbStock As System.Windows.Forms.RadioButton
    Friend WithEvents rbSample As System.Windows.Forms.RadioButton
    Friend WithEvents rbNonStock As System.Windows.Forms.RadioButton
    Friend WithEvents cbActive As System.Windows.Forms.CheckBox
    Friend WithEvents cbPromotion As System.Windows.Forms.CheckBox
    Friend WithEvents cbKit As System.Windows.Forms.CheckBox
    Friend WithEvents dgProduct As System.Windows.Forms.DataGrid
    Friend WithEvents ttHelp As System.Windows.Forms.ToolTip
    Friend WithEvents cbQty As System.Windows.Forms.CheckBox
    Friend WithEvents rbPrice1 As System.Windows.Forms.RadioButton
    Friend WithEvents rbPrice2 As System.Windows.Forms.RadioButton
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents crICpriceList1 As crICpriceList
    Friend WithEvents cmbDepartment As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbBrand As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmdPrint As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdRefresh As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdExit As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmbManuf As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbCategory As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbSubCat As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents GroupPanel1 As DevComponents.DotNetBar.Controls.GroupPanel
    Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
    Friend WithEvents cbZero As System.Windows.Forms.CheckBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.rbStock = New System.Windows.Forms.RadioButton()
        Me.rbSample = New System.Windows.Forms.RadioButton()
        Me.rbNonStock = New System.Windows.Forms.RadioButton()
        Me.dgProduct = New System.Windows.Forms.DataGrid()
        Me.cbActive = New System.Windows.Forms.CheckBox()
        Me.cbPromotion = New System.Windows.Forms.CheckBox()
        Me.cbKit = New System.Windows.Forms.CheckBox()
        Me.gbType = New System.Windows.Forms.GroupBox()
        Me.ttHelp = New System.Windows.Forms.ToolTip(Me.components)
        Me.cbQty = New System.Windows.Forms.CheckBox()
        Me.rbPrice1 = New System.Windows.Forms.RadioButton()
        Me.rbPrice2 = New System.Windows.Forms.RadioButton()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.crICpriceList1 = New crICpriceList()
        Me.cbZero = New System.Windows.Forms.CheckBox()
        Me.cmbDepartment = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbBrand = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmdPrint = New DevComponents.DotNetBar.ButtonX()
        Me.cmdRefresh = New DevComponents.DotNetBar.ButtonX()
        Me.cmdExit = New DevComponents.DotNetBar.ButtonX()
        Me.cmbManuf = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbCategory = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbSubCat = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.GroupPanel1 = New DevComponents.DotNetBar.Controls.GroupPanel()
        Me.GroupBox2 = New System.Windows.Forms.GroupBox()
        CType(Me.dgProduct, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.gbType.SuspendLayout()
        Me.GroupBox1.SuspendLayout()
        Me.GroupPanel1.SuspendLayout()
        Me.GroupBox2.SuspendLayout()
        Me.SuspendLayout()
        '
        'rbStock
        '
        Me.rbStock.AutoSize = True
        Me.rbStock.BackColor = System.Drawing.Color.Transparent
        Me.rbStock.Checked = True
        Me.rbStock.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbStock.Location = New System.Drawing.Point(9, 16)
        Me.rbStock.Name = "rbStock"
        Me.rbStock.Size = New System.Drawing.Size(59, 22)
        Me.rbStock.TabIndex = 9
        Me.rbStock.TabStop = True
        Me.rbStock.Text = "Stock"
        Me.rbStock.UseVisualStyleBackColor = False
        '
        'rbSample
        '
        Me.rbSample.AutoSize = True
        Me.rbSample.BackColor = System.Drawing.Color.Transparent
        Me.rbSample.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbSample.Location = New System.Drawing.Point(73, 16)
        Me.rbSample.Name = "rbSample"
        Me.rbSample.Size = New System.Drawing.Size(78, 22)
        Me.rbSample.TabIndex = 11
        Me.rbSample.Text = "Samples"
        Me.rbSample.UseVisualStyleBackColor = False
        '
        'rbNonStock
        '
        Me.rbNonStock.AutoSize = True
        Me.rbNonStock.BackColor = System.Drawing.Color.Transparent
        Me.rbNonStock.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbNonStock.Location = New System.Drawing.Point(157, 16)
        Me.rbNonStock.Name = "rbNonStock"
        Me.rbNonStock.Size = New System.Drawing.Size(90, 22)
        Me.rbNonStock.TabIndex = 12
        Me.rbNonStock.Text = "Non-Stock"
        Me.rbNonStock.UseVisualStyleBackColor = False
        '
        'dgProduct
        '
        Me.dgProduct.BackColor = System.Drawing.Color.AliceBlue
        Me.dgProduct.BackgroundColor = System.Drawing.Color.AliceBlue
        Me.dgProduct.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.dgProduct.CaptionVisible = False
        Me.dgProduct.DataMember = ""
        Me.dgProduct.HeaderBackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(128, Byte), Integer))
        Me.dgProduct.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgProduct.Location = New System.Drawing.Point(11, 139)
        Me.dgProduct.Name = "dgProduct"
        Me.dgProduct.ReadOnly = True
        Me.dgProduct.Size = New System.Drawing.Size(909, 272)
        Me.dgProduct.TabIndex = 13
        Me.ttHelp.SetToolTip(Me.dgProduct, "Click on Column Header to Sort.  Click in grid to select product")
        '
        'cbActive
        '
        Me.cbActive.AutoSize = True
        Me.cbActive.BackColor = System.Drawing.Color.Transparent
        Me.cbActive.Checked = True
        Me.cbActive.CheckState = System.Windows.Forms.CheckState.Checked
        Me.cbActive.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cbActive.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.cbActive.Location = New System.Drawing.Point(186, 19)
        Me.cbActive.Name = "cbActive"
        Me.cbActive.Size = New System.Drawing.Size(65, 22)
        Me.cbActive.TabIndex = 18
        Me.cbActive.Text = "Active"
        Me.cbActive.UseVisualStyleBackColor = False
        '
        'cbPromotion
        '
        Me.cbPromotion.AutoSize = True
        Me.cbPromotion.BackColor = System.Drawing.Color.Transparent
        Me.cbPromotion.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cbPromotion.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.cbPromotion.Location = New System.Drawing.Point(11, 19)
        Me.cbPromotion.Name = "cbPromotion"
        Me.cbPromotion.Size = New System.Drawing.Size(113, 22)
        Me.cbPromotion.TabIndex = 51
        Me.cbPromotion.Text = "On Promotion"
        Me.cbPromotion.UseVisualStyleBackColor = False
        '
        'cbKit
        '
        Me.cbKit.AutoSize = True
        Me.cbKit.BackColor = System.Drawing.Color.Transparent
        Me.cbKit.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cbKit.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.cbKit.Location = New System.Drawing.Point(130, 19)
        Me.cbKit.Name = "cbKit"
        Me.cbKit.Size = New System.Drawing.Size(50, 22)
        Me.cbKit.TabIndex = 52
        Me.cbKit.Text = "Kits"
        Me.cbKit.UseVisualStyleBackColor = False
        '
        'gbType
        '
        Me.gbType.BackColor = System.Drawing.Color.Transparent
        Me.gbType.Controls.Add(Me.rbSample)
        Me.gbType.Controls.Add(Me.rbStock)
        Me.gbType.Controls.Add(Me.rbNonStock)
        Me.gbType.Location = New System.Drawing.Point(8, 2)
        Me.gbType.Name = "gbType"
        Me.gbType.Size = New System.Drawing.Size(261, 47)
        Me.gbType.TabIndex = 54
        Me.gbType.TabStop = False
        '
        'cbQty
        '
        Me.cbQty.AutoSize = True
        Me.cbQty.BackColor = System.Drawing.Color.Transparent
        Me.cbQty.Checked = True
        Me.cbQty.CheckState = System.Windows.Forms.CheckState.Checked
        Me.cbQty.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cbQty.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.cbQty.Location = New System.Drawing.Point(257, 19)
        Me.cbQty.Name = "cbQty"
        Me.cbQty.Size = New System.Drawing.Size(49, 22)
        Me.cbQty.TabIndex = 55
        Me.cbQty.Text = "Qty"
        Me.cbQty.UseVisualStyleBackColor = False
        '
        'rbPrice1
        '
        Me.rbPrice1.AutoSize = True
        Me.rbPrice1.BackColor = System.Drawing.Color.Transparent
        Me.rbPrice1.Checked = True
        Me.rbPrice1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbPrice1.Location = New System.Drawing.Point(11, 16)
        Me.rbPrice1.Name = "rbPrice1"
        Me.rbPrice1.Size = New System.Drawing.Size(87, 22)
        Me.rbPrice1.TabIndex = 56
        Me.rbPrice1.TabStop = True
        Me.rbPrice1.Text = "First Price"
        Me.rbPrice1.UseVisualStyleBackColor = False
        '
        'rbPrice2
        '
        Me.rbPrice2.AutoSize = True
        Me.rbPrice2.BackColor = System.Drawing.Color.Transparent
        Me.rbPrice2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.rbPrice2.Location = New System.Drawing.Point(106, 16)
        Me.rbPrice2.Name = "rbPrice2"
        Me.rbPrice2.Size = New System.Drawing.Size(105, 22)
        Me.rbPrice2.TabIndex = 57
        Me.rbPrice2.Text = "Second Price"
        Me.rbPrice2.UseVisualStyleBackColor = False
        '
        'GroupBox1
        '
        Me.GroupBox1.BackColor = System.Drawing.Color.Transparent
        Me.GroupBox1.Controls.Add(Me.rbPrice1)
        Me.GroupBox1.Controls.Add(Me.rbPrice2)
        Me.GroupBox1.Location = New System.Drawing.Point(279, 2)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(217, 47)
        Me.GroupBox1.TabIndex = 58
        Me.GroupBox1.TabStop = False
        '
        'cbZero
        '
        Me.cbZero.AutoSize = True
        Me.cbZero.BackColor = System.Drawing.Color.Transparent
        Me.cbZero.Checked = True
        Me.cbZero.CheckState = System.Windows.Forms.CheckState.Checked
        Me.cbZero.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cbZero.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.cbZero.Location = New System.Drawing.Point(312, 19)
        Me.cbZero.Name = "cbZero"
        Me.cbZero.Size = New System.Drawing.Size(80, 22)
        Me.cbZero.TabIndex = 60
        Me.cbZero.Text = "Zero Qty"
        Me.cbZero.UseVisualStyleBackColor = False
        '
        'cmbDepartment
        '
        Me.cmbDepartment.DisplayMember = "Text"
        Me.cmbDepartment.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbDepartment.ItemHeight = 19
        Me.cmbDepartment.Location = New System.Drawing.Point(11, 108)
        Me.cmbDepartment.Name = "cmbDepartment"
        Me.cmbDepartment.Size = New System.Drawing.Size(177, 25)
        Me.cmbDepartment.TabIndex = 201
        '
        'cmbBrand
        '
        Me.cmbBrand.DisplayMember = "Text"
        Me.cmbBrand.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbBrand.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbBrand.ItemHeight = 19
        Me.cmbBrand.Location = New System.Drawing.Point(194, 108)
        Me.cmbBrand.Name = "cmbBrand"
        Me.cmbBrand.Size = New System.Drawing.Size(177, 25)
        Me.cmbBrand.TabIndex = 202
        '
        'cmdPrint
        '
        Me.cmdPrint.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdPrint.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdPrint.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdPrint.Location = New System.Drawing.Point(662, 431)
        Me.cmdPrint.Name = "cmdPrint"
        Me.cmdPrint.Size = New System.Drawing.Size(82, 27)
        Me.cmdPrint.TabIndex = 264
        Me.cmdPrint.Text = "Print"
        '
        'cmdRefresh
        '
        Me.cmdRefresh.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdRefresh.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdRefresh.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdRefresh.Location = New System.Drawing.Point(750, 431)
        Me.cmdRefresh.Name = "cmdRefresh"
        Me.cmdRefresh.Size = New System.Drawing.Size(82, 27)
        Me.cmdRefresh.TabIndex = 265
        Me.cmdRefresh.Text = "Refresh"
        '
        'cmdExit
        '
        Me.cmdExit.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdExit.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdExit.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdExit.Location = New System.Drawing.Point(838, 431)
        Me.cmdExit.Name = "cmdExit"
        Me.cmdExit.Size = New System.Drawing.Size(82, 27)
        Me.cmdExit.TabIndex = 263
        Me.cmdExit.Text = "Exit"
        '
        'cmbManuf
        '
        Me.cmbManuf.DisplayMember = "Text"
        Me.cmbManuf.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbManuf.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbManuf.ItemHeight = 19
        Me.cmbManuf.Location = New System.Drawing.Point(377, 108)
        Me.cmbManuf.Name = "cmbManuf"
        Me.cmbManuf.Size = New System.Drawing.Size(177, 25)
        Me.cmbManuf.TabIndex = 267
        '
        'cmbCategory
        '
        Me.cmbCategory.DisplayMember = "Text"
        Me.cmbCategory.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbCategory.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbCategory.ItemHeight = 19
        Me.cmbCategory.Location = New System.Drawing.Point(560, 108)
        Me.cmbCategory.Name = "cmbCategory"
        Me.cmbCategory.Size = New System.Drawing.Size(177, 25)
        Me.cmbCategory.TabIndex = 266
        '
        'cmbSubCat
        '
        Me.cmbSubCat.DisplayMember = "Text"
        Me.cmbSubCat.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbSubCat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbSubCat.ItemHeight = 19
        Me.cmbSubCat.Location = New System.Drawing.Point(743, 108)
        Me.cmbSubCat.Name = "cmbSubCat"
        Me.cmbSubCat.Size = New System.Drawing.Size(177, 25)
        Me.cmbSubCat.TabIndex = 266
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.BackColor = System.Drawing.Color.Transparent
        Me.Label3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label3.Location = New System.Drawing.Point(9, 63)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(83, 18)
        Me.Label3.TabIndex = 270
        Me.Label3.Text = "Department"
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.BackColor = System.Drawing.Color.Transparent
        Me.Label6.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label6.Location = New System.Drawing.Point(192, 63)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(44, 18)
        Me.Label6.TabIndex = 269
        Me.Label6.Text = "Brand"
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.BackColor = System.Drawing.Color.Transparent
        Me.Label7.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label7.Location = New System.Drawing.Point(373, 63)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(92, 18)
        Me.Label7.TabIndex = 268
        Me.Label7.Text = "Manufacturer"
        '
        'Label9
        '
        Me.Label9.AutoSize = True
        Me.Label9.BackColor = System.Drawing.Color.Transparent
        Me.Label9.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label9.Location = New System.Drawing.Point(741, 63)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(89, 18)
        Me.Label9.TabIndex = 272
        Me.Label9.Text = "Sub Category"
        '
        'Label8
        '
        Me.Label8.AutoSize = True
        Me.Label8.BackColor = System.Drawing.Color.Transparent
        Me.Label8.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label8.Location = New System.Drawing.Point(558, 63)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(63, 18)
        Me.Label8.TabIndex = 271
        Me.Label8.Text = "Category"
        '
        'GroupPanel1
        '
        Me.GroupPanel1.BackColor = System.Drawing.SystemColors.ActiveCaption
        Me.GroupPanel1.CanvasColor = System.Drawing.SystemColors.Control
        Me.GroupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007
        Me.GroupPanel1.Controls.Add(Me.GroupBox2)
        Me.GroupPanel1.Controls.Add(Me.Label9)
        Me.GroupPanel1.Controls.Add(Me.gbType)
        Me.GroupPanel1.Controls.Add(Me.Label8)
        Me.GroupPanel1.Controls.Add(Me.GroupBox1)
        Me.GroupPanel1.Controls.Add(Me.Label3)
        Me.GroupPanel1.Controls.Add(Me.Label6)
        Me.GroupPanel1.Controls.Add(Me.Label7)
        Me.GroupPanel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.GroupPanel1.Location = New System.Drawing.Point(0, 0)
        Me.GroupPanel1.Name = "GroupPanel1"
        Me.GroupPanel1.Size = New System.Drawing.Size(932, 480)
        '
        '
        '
        Me.GroupPanel1.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2
        Me.GroupPanel1.Style.BackColorGradientAngle = 90
        Me.GroupPanel1.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground
        Me.GroupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderBottomWidth = 1
        Me.GroupPanel1.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder
        Me.GroupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderLeftWidth = 1
        Me.GroupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderRightWidth = 1
        Me.GroupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderTopWidth = 1
        Me.GroupPanel1.Style.CornerDiameter = 4
        Me.GroupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded
        Me.GroupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center
        Me.GroupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText
        Me.GroupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near
        Me.GroupPanel1.TabIndex = 273
        Me.GroupPanel1.Text = "Price Report"
        '
        'GroupBox2
        '
        Me.GroupBox2.BackColor = System.Drawing.Color.Transparent
        Me.GroupBox2.Controls.Add(Me.cbZero)
        Me.GroupBox2.Controls.Add(Me.cbQty)
        Me.GroupBox2.Controls.Add(Me.cbKit)
        Me.GroupBox2.Controls.Add(Me.cbPromotion)
        Me.GroupBox2.Controls.Add(Me.cbActive)
        Me.GroupBox2.Location = New System.Drawing.Point(502, 2)
        Me.GroupBox2.Name = "GroupBox2"
        Me.GroupBox2.Size = New System.Drawing.Size(394, 47)
        Me.GroupBox2.TabIndex = 273
        Me.GroupBox2.TabStop = False
        '
        'frmPriceReport
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
        Me.BackColor = System.Drawing.Color.SteelBlue
        Me.ClientSize = New System.Drawing.Size(932, 480)
        Me.ControlBox = False
        Me.Controls.Add(Me.cmbManuf)
        Me.Controls.Add(Me.cmbSubCat)
        Me.Controls.Add(Me.cmbCategory)
        Me.Controls.Add(Me.cmdPrint)
        Me.Controls.Add(Me.cmdRefresh)
        Me.Controls.Add(Me.cmdExit)
        Me.Controls.Add(Me.cmbBrand)
        Me.Controls.Add(Me.cmbDepartment)
        Me.Controls.Add(Me.dgProduct)
        Me.Controls.Add(Me.GroupPanel1)
        Me.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ForeColor = System.Drawing.Color.White
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Location = New System.Drawing.Point(30, 70)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmPriceReport"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        CType(Me.dgProduct, System.ComponentModel.ISupportInitialize).EndInit()
        Me.gbType.ResumeLayout(False)
        Me.gbType.PerformLayout()
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox1.PerformLayout()
        Me.GroupPanel1.ResumeLayout(False)
        Me.GroupPanel1.PerformLayout()
        Me.GroupBox2.ResumeLayout(False)
        Me.GroupBox2.PerformLayout()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub ICproducts_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadGroupCombos(CompanyID)
        If CompanyID = 3 Then
            rbPrice1.Checked = True
        Else
            rbPrice2.Checked = True
        End If
        '
    End Sub
    Private Sub LoadGroupCombos(ByVal CompanyCode As Integer)
        Dim ICdata As New ICdataLogic
        Dim ds As DataSet

        ds = ICdata.GetProductGroups(CompanyCode, 1)
        cmbDepartment.DataSource = ds.Tables(0)
        cmbDepartment.ValueMember = "GroupID"
        cmbDepartment.DisplayMember = "GroupName"
        cmbDepartment.SelectedValue = 0
        '
        ds = ICdata.GetProductGroups(CompanyCode, 2)
        cmbBrand.DataSource = ds.Tables(0)
        cmbBrand.ValueMember = "GroupID"
        cmbBrand.DisplayMember = "GroupName"
        cmbBrand.SelectedValue = 0
        '
        ds = ICdata.GetProductGroups(CompanyCode, 3)
        cmbManuf.DataSource = ds.Tables(0)
        cmbManuf.ValueMember = "GroupID"
        cmbManuf.DisplayMember = "GroupName"
        cmbManuf.SelectedValue = 0
        '
        ds = ICdata.GetProductGroups(CompanyCode, 4)
        cmbCategory.DataSource = ds.Tables(0)
        cmbCategory.ValueMember = "GroupID"
        cmbCategory.DisplayMember = "GroupName"
        cmbCategory.SelectedValue = 0
        '
        ds = ICdata.GetProductGroups(CompanyCode, 5)
        cmbSubCat.DataSource = ds.Tables(0)
        cmbSubCat.ValueMember = "GroupID"
        cmbSubCat.DisplayMember = "GroupName"
        cmbSubCat.SelectedValue = 0
        '
        ICdata = Nothing
    End Sub
    Private Sub cmdRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRefresh.Click
        Dim WhereClause As String = ""
        'WhereClause = " where CompanyCode=" & CompanyID
        Dim PromotFlag As Integer
        Dim KitFlag As Integer
        Dim ActiveFlag As Integer
        If cbPromotion.Checked = True Then
            PromotFlag = 1
        Else
            PromotFlag = 0
        End If
        If cbKit.Checked = True Then
            KitFlag = 1
        Else
            KitFlag = 0
        End If
        If cbActive.Checked = True Then
            ActiveFlag = 1
        Else
            ActiveFlag = 0
        End If
        WhereClause += " and OnPromotionFlag=" & PromotFlag
        WhereClause += " and KitFlag=" & KitFlag
        WhereClause += " and ActiveFlag=" & ActiveFlag
        Dim ProdType As Integer
        ProdType = 1
        If rbStock.Checked = True Then
            ProdType = 1
        Else
            If rbSample.Checked = True Then
                ProdType = 2
            Else
                If rbNonStock.Checked = True Then
                    ProdType = 3
                End If
            End If
        End If
        WhereClause += " and ProductType=" & ProdType
        If cmbDepartment.SelectedValue <> 0 Then
            WhereClause += " and Group1Code=" & cmbDepartment.SelectedValue
        End If
        If cmbBrand.SelectedValue <> 0 Then
            WhereClause += " and Group2Code=" & cmbBrand.SelectedValue
        End If
        If cmbManuf.SelectedValue <> 0 Then
            WhereClause += " and Group3Code=" & cmbManuf.SelectedValue
        End If
        If cmbCategory.SelectedValue <> 0 Then
            WhereClause += " and Group4Code=" & cmbCategory.SelectedValue
        End If
        If cmbSubCat.SelectedValue <> 0 Then
            WhereClause += " and Group5Code=" & cmbSubCat.SelectedValue
        End If
        Dim ICdata As New ICdataLogic

        Dim ds As DataSet

        ds = ICdata.GetPriceList(CompanyID, WhereClause)

        Dim Fprice, Sprice, Acost, Tcost As Decimal
        Dim Cqty, Aqty, Lqty As Integer
        Dim Oldpcode As String
        Dim Lc As Integer
        Dim drow As DataRow
        For Each drow In ds.Tables(0).Rows

            If CDbl(drow("FirstPrice")) = 0 Then
                drow("FirstPrice") = System.DBNull.Value
            End If
            If CDbl(drow("SecondPrice")) = 0 Then
                drow("SecondPrice") = System.DBNull.Value
            End If
            If CompanyID <> 3 Then
                If drow("ProductCode") = drow("ProductBarCode") Then
                    Lc = 1
                    Try
                        Oldpcode = drow("ProductCode")
                        Fprice = drow("FirstPrice")
                        Sprice = drow("SecondPrice")
                        Lqty = drow("AvlQty")
                    Catch ex As Exception

                    End Try
                    drow.Delete()
                Else
                    If Lc = 1 Then
                        If drow("ProductCode") = Oldpcode Then
                            drow("FirstPrice") = Fprice
                            drow("SecondPrice") = Sprice
                            drow("AvlQty") = Lqty
                        End If
                        Lc = 2
                        Fprice = 0.0
                        Sprice = 0.0
                        Acost = 0.0
                        Tcost = 0.0
                        Aqty = 0
                        Cqty = 0
                        Lqty = 0
                    End If
                    'Dim Barcode As String
                    'Dim BarCount As Integer
                    ''Dim dRow As DataRow
                    ''For Each drow In ds.Tables(0).Rows
                    'Barcode = CStr(drow("ProductBarCode"))
                    'BarCount = CInt(Len(Barcode))
                    'If BarCount <= 10 Then
                    '    drow.Delete()
                    'End If
                End If
            End If
            Try
                If cbZero.Checked = False Then
                    If Integer.Parse(drow("AvlQty")) <= 0 Then
                        drow.Delete()
                    End If
                End If
            Catch ex As Exception

            End Try
        Next
        dgProduct.DataSource = ds.Tables(0)
        With dgProduct
            ' .BackgroundColor = GridBackgroundColor
            .TableStyles.Clear()
            .CaptionBackColor = System.Drawing.Color.SlateBlue
            .CaptionForeColor = System.Drawing.Color.LemonChiffon
            .AllowSorting = True
            .AlternatingBackColor = System.Drawing.Color.AliceBlue
            .ParentRowsBackColor = System.Drawing.Color.Lavender
            .ParentRowsForeColor = System.Drawing.Color.SlateBlue
            .HeaderBackColor = System.Drawing.Color.LemonChiffon
            .AllowNavigation = False
            .ParentRowsVisible = False
            .RowHeadersVisible = False
        End With
        Dim cm As CurrencyManager = BindingContext(dgProduct.DataSource, dgProduct.DataMember)
        Dim dv As DataView = cm.List
        dv.AllowNew = False
        dgformat(ds.Tables(0).Rows.Count)
        ICdata = Nothing
    End Sub
    Private Sub dgformat(ByVal RowCount As Integer)
        Dim grdTableStyle As New DataGridTableStyle
        With grdTableStyle
            .AlternatingBackColor = Color.AliceBlue
            .HeaderFont = New Font("Tahoma", 8.0!, FontStyle.Bold)
            .MappingName = "PRODUCT"
            .PreferredColumnWidth = 160
            .HeaderBackColor = Color.LightSlateGray
            .HeaderForeColor = Color.LightCyan
            .PreferredRowHeight = 15
            .RowHeadersVisible = False
            .RowHeaderWidth = 0
        End With
        Dim cs1 As DataGridColumnStyle
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 0
        cs1.MappingName = "PRODUCTID"
        cs1.HeaderText = "CODE"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 115
        cs1.MappingName = "GROUPNAME"
        cs1.HeaderText = "BRAND"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        ''
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 118
        cs1.MappingName = "MANUFPRODUCTCODE"
        cs1.HeaderText = "MANUF.CODE"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 118
        cs1.MappingName = "PRODUCTBARCODE"
        cs1.HeaderText = "BAR CODE"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 210
        cs1.MappingName = "SHORTDESCRIPTIONE"
        cs1.HeaderText = "DESCRIPTION"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        If rbPrice1.Checked = True Then
            cs1 = New DataGridTextBoxColumn
            cs1.Width = 80
            cs1.MappingName = "FIRSTPRICE"
            cs1.HeaderText = "Ist PRICE"
            cs1.NullText = ""
            cs1.ReadOnly = True
            cs1.Alignment = HorizontalAlignment.Right
            grdTableStyle.GridColumnStyles.Add(cs1)
        Else
            cs1 = New DataGridTextBoxColumn
            cs1.Width = 80
            cs1.MappingName = "SECONDPRICE"
            cs1.HeaderText = "2nd PRICE"
            cs1.NullText = ""
            cs1.ReadOnly = True
            cs1.Alignment = HorizontalAlignment.Right
            grdTableStyle.GridColumnStyles.Add(cs1)
        End If
        '
        cs1 = New DataGridTextBoxColumn
        If RowCount > 12 Then
            cs1.Width = 65
        Else
            cs1.Width = 80
        End If
        If cbQty.Checked = True Then
            cs1.MappingName = "AVLQTY"
            cs1.HeaderText = "AVL.QTY"
            cs1.NullText = ""
            cs1.ReadOnly = True
            cs1.Alignment = HorizontalAlignment.Right
            grdTableStyle.GridColumnStyles.Add(cs1)
            '
        End If
        dgProduct.TableStyles.Add(grdTableStyle)
    End Sub

    Private Sub cmbCompany_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
        LoadGroupCombos(CompanyID)
    End Sub

    Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
        Me.Hide()
    End Sub

    Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'icpAdd = New ICproductsAdd
        'Me.Hide()
        'icpAdd.Show()
    End Sub

    Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'Dim CurrentRow As Integer = dgProduct.CurrentCell.RowNumber
        'dgProductSelectedID = dgProduct.Item(CurrentRow, 0)
        'icpEdit = New ICproductsEdit
        'Me.Hide()
        'icpEdit.Show()
    End Sub

    Private Sub dgProduct_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dgProduct.MouseUp
        Dim pt As New Point(e.X, e.Y)
        Dim hti As DataGrid.HitTestInfo = dgProduct.HitTest(pt)
        If hti.Type = DataGrid.HitTestType.Cell Then
            dgProduct.CurrentCell = New DataGridCell(hti.Row, hti.Column)
            dgProduct.Select(hti.Row)
            'Dim CurrentRow As Integer = dgProduct.CurrentCell.RowNumber
            'dgProductSelectedID = dgProduct.Item(CurrentRow, 0)
            'Me.Hide()
            'icpEdit = New ICproductsEdit
            'icpEdit.Show()
        End If
    End Sub

    Private Sub btnCut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'Dim CurrentRow As Integer = dgProduct.CurrentCell.RowNumber
        'dgProduct.Select(CurrentRow)
        'Dim ProdDelID As String = dgProduct.Item(CurrentRow, 0)
        'Dim ProdDelCode As String = dgProduct.Item(CurrentRow, 1)
        'Dim ProdDelDesc As String = dgProduct.Item(CurrentRow, 3)
        'If MsgBox("Are you sure to delete Product:" & ProdDelCode & vbLf & ProdDelDesc, MsgBoxStyle.YesNo, "Inventory Manager") = MsgBoxResult.Yes Then
        '    Dim ICdata As New ICdataLogic
        '    Try
        '        ICdata.DeleteProduct(ProdDelID)
        '        MsgBox("Product:" & ProdDelCode & " deleted.", MsgBoxStyle.Information, "Inventory Manager")
        '        btnRefresh.PerformClick()
        '    Catch ex As Exception
        '        MsgBox("Unable to satisfy your request." & vbLf & "Try again later.", MsgBoxStyle.Critical, "Inventory Manager")
        '    Finally
        '        ICdata = Nothing
        '    End Try
        'End If
    End Sub

    Private Sub cmdPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPrint.Click
        Me.Cursor = Cursors.WaitCursor

        Dim ds As DataSet = New DataSet("SerpsRpt")
        Dim table As DataTable = New DataTable("SerpsRpt")
        table.Columns.Add("Str1")
        table.Columns.Add("Str2")
        table.Columns.Add("Str3")
        table.Columns.Add("Str4")
        table.Columns.Add("Dec1")
        table.Columns.Add("Int1")


        Dim mrow, drow As Integer
        Dim cm As CurrencyManager = BindingContext(dgProduct.DataSource, dgProduct.DataMember)
        Dim dv As DataView = cm.List
        dv.RowStateFilter = DataViewRowState.CurrentRows
        mrow = dv.Count
        'mrow = mrow - drow
        Dim ProdCode As String
        Dim ProdDesc As String
        Dim ProdQty As String

        Dim n As Integer
        For n = 0 To mrow - 1
            Dim nrow As DataRow = table.NewRow()
            nrow("Str1") = dgProduct.Item(n, 3)
            nrow("Str2") = dgProduct.Item(n, 2)
            nrow("Str3") = dgProduct.Item(n, 4)
            nrow("Str4") = dgProduct.Item(n, 1)
            nrow("Dec1") = dgProduct.Item(n, 5)
            If cbQty.Checked = True Then
                nrow("Int1") = dgProduct.Item(n, 6)
            Else
                nrow("Int1") = "0"
            End If
            table.Rows.Add(nrow)
        Next
        ds.Tables.Add(table)

        crICpriceList1.Load()
        crICpriceList1.SetDataSource(ds)

        crICpriceList1.SetParameterValue("CompanyName", CompanyTitle)
        crICpriceList1.SetParameterValue("ReportTitle", "Price List")
        crICpriceList1.SetParameterValue("CriteriaTitle", cmbDepartment.Text + "/" + cmbBrand.Text + "/" + cmbManuf.Text + "/" + cmbCategory.Text + "/" + cmbSubCat.Text)
        If PrntPrv Is Nothing Then
            PrntPrv = New PrintPreviewForm
            PrntPrv.CrRptView.ReportSource = crICpriceList1
            PrntPrv.ShowDialog()
        End If
        crICpriceList1.Close()
        'crICpriceList.PrintOptions.PrinterName = InvoicePrinter
        'Try
        '    crICpriceList1.PrintToPrinter(1, True, 0, 0)
        'Catch ex As Exception
        '    MsgBox(ex.ToString)
        'End Try
        Me.Cursor = Cursors.Default

    End Sub
End Class
